class iGamePawn_Player extends iGamePawn
	hidecategories(AI)
	placeable;

//=============================================================================
// Effects
//=============================================================================
var protected ParticleSystemComponent			PlayerHighlight;
var(Effects) protected const ParticleSystem	    PlayerHighlightTemplate;

//=============================================================================
// Camera
//=============================================================================
/** If true, camera rotates with player */
var bool bFollowPlayerRotation;
/** distance to offset the camera from the player */
var float CamOffsetDistance;
/** Camera angle to pawn */
var int CameraAngle;

//=============================================================================
// Functions Camera
//=============================================================================
simulated function bool CalcCamera( float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV )
{
   out_CamLoc = Location;
   out_CamLoc.X -= Cos(CameraAngle * DegToRad) * CamOffsetDistance;
   out_CamLoc.Z += Sin(CameraAngle * DegToRad) * CamOffsetDistance;

   if(!bFollowPlayerRotation)
   {
      out_CamRot.Pitch = - CameraAngle * DegToUnrRot; //-16384; for top-down
      out_CamRot.Yaw = 0;
      out_CamRot.Roll = 0;
   }
   else
   {
      out_CamRot.Pitch = - CameraAngle * DegToUnrRot; //-16384;
      out_CamRot.Yaw = Rotation.Yaw;
      out_CamRot.Roll = 0;
   }

   return true;
}

//=============================================================================
// Functions
//=============================================================================
simulated function PostBeginPlay()
{
	Super.PostBeginPlay();
	PlayerHighlight = ShowEffect(PlayerHighlightTemplate);
}

function bool Died(Controller Killer, class<DamageType> DamageType, vector HitLocation)
{
	if (PlayerHighlight != none)
	{
		PlayerHighlight.DeactivateSystem();
		PlayerHighlight = none;
	}

	return super.Died(Killer, DamageType, HitLocation);
}

//=============================================================================
// default properties
//=============================================================================
defaultproperties
{
	bFollowPlayerRotation = false;
	CameraAngle = 60 //90 //75
	CamOffsetDistance = 512.0 //2048.0

	BloodColor = (R = 0, G= 1, B=0, A=1)
}